package com.useeinfo.asg.open.web;

import com.useeinfo.asg.modules.security.entity.SystemUser;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by MISAYA on 2016/10/13.
 */

@Component
public class CommUserUtil {

    public static SystemUser getUser(HttpServletRequest request) {

        SystemUser user = null;
        Object sessionUser = request.getSession().getAttribute("user");
        if(sessionUser!=null) {
            user = (SystemUser) sessionUser;
        }
        return user;
    }
}
